import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import AllGallery from '../views/AllGallery'
import navBar from '../components/common/navbar'
import galleryContent from '../components/AllGallery/galleryContent'
import galleryCard from '../components/AllGallery/galleryCard'
import UploadGallery from '../views/UploadGallery'
import UserCenter from '../views/UserCenter'
import Subscribe from '../views/Subscribe'
import AdminCenter from '../views/AdminCenter'
import search from '../views/search'
import Tag from '../components/AllGallery/Tag'
import upman from '../views/upman'
import zone from '../views/zone'
import searchpro from '../views/searchpro'
import chartLint from '../components/userCom/chartLint'
import chartLint2 from '../components/userCom/chartLint2'
import chartLint3 from '../components/userCom/chartLint3'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path:'/searchpro',
    name:'searchpro',
    component:searchpro,
    children:[
      {
        path:'/navbar',
        name:'navBar',
        component: navBar
      },
    ]
  },
  {
    path: '/UserCenter',
    name:'UserCenter',
    component:UserCenter,
    meta: { navShow: true },
    children:[
      {
        path:'/navbar',
        name:'navBar',
        component: navBar
      },
      {
        path:'/chartLint',
        name:'chartLint',
        component:chartLint
      },
    ]
  },
  {
    path:'/zone',
    name:'zone',
    component:zone,
    children:[
      {
        path:'/navbar',
        name:'navBar',
        component: navBar
      },
      {
        path:'/chartLint',
        name:'chartLint',
        component:chartLint
      },
    ]
  },
  {
    path:'/search',
    name:'search',
    component:search
  },
  {
    path: '/AdminCenter',
    name:'AdminCenter',
    component:AdminCenter,
    children:[
      {
        path:'/navbar',
        name:'navBar',
        component: navBar
      },
    ]
  },
  {
    path: '/upman',
    name:'upman',
    component:upman,
    children:[
      {
        path:'/navbar',
        name:'navBar',
        component: navBar
      },
    ]
  },
  {
    path: '/Friend',
    name: 'Friend',
    component: () => import('../views/friendExample'),
    children:[
      {
        path: '/navbar',
        name: 'navBar',
        component: navBar
      },
    ]
  },
  {
    path: '/AllGallery',
    name: 'AllGallery',
    component: AllGallery,
    meta: { navShow: true },
    children: [
      {
        path: '/navbar',
        name: 'navBar',
        component: navBar
      },
      {
        path: '/galleryContent',
        name: 'galleryContent',
        component: galleryContent
      },
      {
        path: '/galleryCard/:id',
        name: 'galleryCard',
        component: galleryCard,
        props: true
      },
      {
        path:'/tag',
        name:'tag',
        component:Tag
      }
    ]
  },
  {
    path: '/Subscribe',
    name: 'Subscribe',
    component: Subscribe,
    meta: { navShow: true },
    children: [
      {
        path: '/navbar',
        name: 'navBar',
        component: navBar
      },
      {
        path: '/galleryContent',
        name: 'galleryContent',
        component: galleryContent
      },
      {
        path: '/galleryCard/:id',
        name: 'galleryCard',
        component: galleryCard,
        props: true
      }
    ]
  },
  {
    path: '/UploadGallery',
    name: 'UploadGallery',
    component: UploadGallery,
    meta: { navShow: true },
    children:[
      {
        path: '/navbar',
        name: 'navBar',
        component: navBar
      },
      {
        path:'/chartLint3',
        name:'chartLint3',
        component:chartLint3
      },
    ]
  },
  {
    path: '/test',
    name: 'test',
    component: () => import('../views/test')
  },
  {
    path: '/uiHome',
    name: 'uiHome',
    component: () => import('../views/uiHome')
  },
  {
    path: '/forum',
    name: 'Forum',
    component: () => import('../views/Forum')
  },
  {
    path: '/post',
    name: 'Post',
    component: () => import('../views/Post')
  },
  {
    path: '/WritePost',
    name: 'WritePost',
    component: () => import('../views/WritePost')
  },
  {
    path: '/Gallery',
    name: 'Gallery',
    component: () => import('../views/Gallery')
  },
  {
    path: '/Friend',
    name: 'Friend',
    component: () => import('../views/friendExample'),
    children:[
      {
        path: '/navbar',
        name: 'navBar',
        component: navBar
      },
      {
        path:'/chartLint2',
        name:'chartLint2',
        component:chartLint2
      },
    ]
  },
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
